#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QStackedWidget>
#include <QWidget>
#include <QLabel>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QPushButton>
#include <QGraphicsDropShadowEffect>

#include "LoginWidget.h"
#include "TopbarWidget.h"
#include "MainPageWidget.h"

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

    MainPageWidget* getMainPageWidget() const;

protected:
    void resizeEvent(QResizeEvent *event) override;

private slots:
    void onLoginSuccess();
    void onLoginFailed();
    void onForgotPassword();
    void onExitApplication();
    void onLogoutRequested();
    void onModuleSelected(const QString &moduleName);
    void onNavigationSelectedByIndex(int stoveIndex, int pageIndex);

private:
    void setupUI();
    void setupContentArea();
    void setupConnections();
    
    // UI组件
    QWidget *m_centralWidget;
    QVBoxLayout *m_mainLayout;
    
    // 顶部标题栏
    TopbarWidget *m_topBarWidget;
    
    // 内容区域
    QStackedWidget *m_contentStack;
    LoginWidget *m_loginWidget;
    MainPageWidget *m_mainPageWidget;
};

#endif // MAINWINDOW_H
